package mx.com.matersys.vacs.domain;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "planservicio")
public class Planservicio {
	
	@Id
	@TableGenerator(name="GEN_PLAN_SERV", table="sequence", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="SEQ_PLAN_SERV", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_PLAN_SERV")
    @Column(name = "idplanservicio")
    private Integer idplanservicio;
	
	@OneToMany(mappedBy = "idplanservicio")
    private Set<Paciente> pacientes;
    
    @ManyToOne
    @JoinColumn(name = "idestatus", referencedColumnName = "idestatus")
    private Estatus idestatus;
    
    @Column(name = "costo")
    private Float costo;
    
    @Column(name = "descripcion", length = 300)
    private String descripcion;
    
    @Column(name = "fechaFin")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="d/M/yy")
    private Date fechaFin;
        
    @Column(name = "fechaInicio")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="d/M/yy")
    private Date fechaInicio;
    
    @Column(name = "isActivo")
    private Boolean isActivo;
}
